

*** Load files and set parameters


* Load the 2021 survey data
use  "2021-survey-stata-dataset.dta", clear

* Set the survey parameters
svyset ResponseId [pweight = weights]


*** Test significance of difference in mean support for spending more on relief and on prevention (see manuscript p. 10)


* Run relief regression and store results
quietly svy: reg more_relief
estimates store r_reg

* Run prevention regression and store results
quietly svy: reg more_prevention
estimates store p_reg

* Display coefficients from both models
estimates table r_reg p_reg

* Combine model output and test significance of difference
quietly suest r_reg p_reg
test [r_reg]_cons = [p_reg]_cons


*** Test the significance of difference in the effect of exposure on different outcomes (see section A.8 of the appendix)


* Run covid exposure regressions and store results
quietly svy: reg more_relief i.age i.race i.gender i.party covid_exposure
estimates store r_reg
quietly svy: reg more_prevention i.age i.race i.gender i.party covid_exposure
estimates store p_reg

* Display coefficients from both models
estimates table r_reg p_reg

* Combine model output and test for significant difference
quietly suest r_reg p_reg
test [r_reg]covid_exposure = [p_reg]covid_exposure

* Run disaster exposure regressions and store results
quietly svy: reg more_relief i.age i.race i.gender i.party disaster_exposure
estimates store r_reg
quietly svy: reg more_prevention i.age i.race i.gender i.party disaster_exposure
estimates store p_reg

* Display coefficients from both models
estimates table r_reg p_reg

* Combine model output and test for significant difference
quietly suest r_reg p_reg
test [r_reg]disaster_exposure = [p_reg]disaster_exposure


*** Test the significance of difference in the effect of exposure types on the same outcome (see Section A.7 of the appendix)


* Run relief regressions and store results
quietly svy: reg more_relief i.age i.race i.gender i.party covid_exposure
estimates store covid_reg
quietly svy: reg more_relief i.age i.race i.gender i.party disaster_exposure
estimates store disaster_reg

* Display coefficients from both models
estimates table covid_reg disaster_reg

* Combine model output and test for significant difference
quietly suest covid_reg disaster_reg
test [covid_reg]covid_exposure = [disaster_reg]disaster_exposure

* Run prevention regressions and store results
quietly svy: reg more_prevention i.age i.race i.gender i.party covid_exposure
estimates store covid_reg
quietly svy: reg more_prevention i.age i.race i.gender i.party disaster_exposure
estimates store disaster_reg

* Display coefficients from both models
estimates table covid_reg disaster_reg

* Combine model output and test for significant difference
quietly suest covid_reg disaster_reg
test [covid_reg]covid_exposure = [disaster_reg]disaster_exposure

* Run prefer prevention regressions and store results
svy: reg prefer_prevention i.age i.race i.gender i.party covid_exposure
estimates store covid_reg
svy: reg prefer_prevention i.age i.race i.gender i.party disaster_exposure
estimates store disaster_reg

* Display coefficients from both models
estimates table covid_reg disaster_reg

* Combine model output and test for significant difference
quietly suest covid_reg disaster_reg
test [covid_reg]covid_exposure = [disaster_reg]disaster_exposure
